<template>
	<xh-container btnText="保存" @onSave="handleClickSubmit" title="编辑">
		<view class="container">
			<uni-forms ref="form1" :rules="rules1" :modelValue="formData" :label-width="80" label-align="right">
				<uni-forms-item label="任务名称" name="taskName">
					<uni-easyinput type="text" v-model="formData.taskName" disabled />
				</uni-forms-item>
				<uni-forms-item label="时效" name="remark">
					<uni-easyinput type="text" v-model="formData.remark" disabled />
				</uni-forms-item>
				<uni-forms-item label="图片" name="imagePath">
					<xh-image :src="formData.imagePath" @onSuccess="handleSuccessImg" />
				</uni-forms-item>
			</uni-forms>
		</view>
	</xh-container>
</template>

<script>
	import {
		decodeParams
	} from "@/utils/common.js";
	import {
		formatSelectList
	} from "@/utils/business.js";
	export default {
		data() {
			return {
				formData: {},
				rules1: {},
			};
		},
		onLoad(options) {
			this.formData = decodeParams(options);
		},
		methods: {
			handleSuccessImg(url) {
				this.detailData = {
					...this.detailData,
					picturePath: url,
				};
			},
		},
	};
</script>
<style scoped lang="scss">
	.container {
		padding: 10px;
	}
</style>